//
//  BPRootViewController.m
//  BP_NewClient
//
//  Created by normal on 15-3-7.
//  Copyright (c) 2015年 normal. All rights reserved.
//

#import "BPRootViewController.h"
#import "iToast.h"
#import "AppDelegate.h"

@interface BPRootViewController ()

@end

@implementation BPRootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
    self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)hideTabbar:(BOOL)hidden{
    [[AppDelegate shareApplication] hidesTabBar:hidden animated:YES];
}

// oc文件使用
- (void)setBackBarItem{
    self.navigationItem.backBarButtonItem = BACK_BAR_BUTTON_BACK(@selector(back:));
}

- (void)setRightImageBarItem:(NSString *)imgStr Action:(SEL)selector{
    self.navigationItem.rightBarButtonItem = BAR_BUTTON_TITLE(imgStr, selector);
}

- (void)setRightTitleBarItem:(NSString *)title Action:(SEL)selector{
    self.navigationItem.rightBarButtonItem = BAR_BUTTON_TITLE(title, selector);
}

- (void)back:(id)sender{
    [self.navigationController popViewControllerAnimated:YES];
}

// swift文件使用
// left
- (UIBarButtonItem *)getBackNavigationItem{
    return BACK_BAR_BUTTON_BACK(@selector(back:));
}
// right
- (UIBarButtonItem *)getRightNavigationItem:(NSString *)imgStr Action:(SEL)selector{
   return  BAR_BUTTON_IMAGE(imgStr, selector);
}

- (void)showNoticeMsg:(NSString *)msg{
    [[iToast makeText:msg] show];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
